#ifndef _INFRARED_H_
#define _INFRARED_H_

/* Includes ------------------------------------------------------------------*/
#include "module/mdef.h"

/* Public typedef ------------------------------------------------------------*/

#define INFRARED_CODING_XIAOMI    1   


#if defined(INFRARED_CODING_XIAOMI)
    #define INFRARE_MAX_COUNT   13  
#elif defined(INFRARED_CODING_COMMON)

#else

#endif

struct Pluse
{
    int32_t high;
    int32_t low;
};

struct Infrared
{
    struct Pluse listPluse[INFRARE_MAX_COUNT];     
    int32_t     counter;
    uint64_t    command;
    
    void (*Hook_ReceiveCommand)(int32_t command);
};

#define INFRARED_COMMAND_UP         0
#define INFRARED_COMMAND_DOWN       1
#define INFRARED_COMMAND_LEFT       2
#define INFRARED_COMMAND_RIGHT      3
#define INFRARED_COMMAND_CONFIRM    4
#define INFRARED_COMMAND_POWER      5
#define INFRARED_COMMAND_HOME       6
#define INFRARED_COMMAND_BACK       7
#define INFRARED_COMMAND_MENU       8
#define INFRARED_COMMAND_INCREASE   9
#define INFRARED_COMMAND_REDUCE     10

/* Public define -------------------------------------------------------------*/
/* Public macro --------------------------------------------------------------*/
/* Public variables ----------------------------------------------------------*/
/* Public function prototypes ------------------------------------------------*/
void Infrared_Trig(struct Infrared *infrared, bool isFalling, int32_t durationUs);
void Infrared_Reset(struct Infrared *infrared);
#endif
